﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace MiniPac.Components
{
	class Tile
	{

		protected int X;
		protected int Y;

		protected int type;

		public int Type { get { return type; } set { type = value; } }

		Color color = Color.Blue;

		//Bounding Box
		public Rectangle BB { get { return new Rectangle(X, Y, R.Size, R.Size); } }

		public Tile(int x, int y, Color c, int type)
		{
			X = x;
			Y = y;
			color = c;
			this.type = type;
		}

		public virtual void Draw(SpriteBatch sb)
		{
			
			if (type == 6)
			{
				Rectangle r = new Rectangle(X, Y, R.Size, R.Size);
				r.Inflate(-5, -5);
				sb.Draw(R.Tile, r, Color.PeachPuff);
			} else if (type == 9)
			{
				Rectangle r = new Rectangle(X, Y, R.Size, R.Size);
				r.Inflate(-3, -3);
				sb.Draw(R.Tile, r, Color.White);
			} 
			else if (type == 3)
			{
				Rectangle r = new Rectangle(X, Y, R.Size, R.Size);
				r.Inflate(0, -1);
				sb.Draw(R.Tile, r, Color.LightPink);
			} 
			else{ sb.Draw(R.Tile, BB, color);}
		}

	}

}
